<?php

//$field="[php_property:field]";
$field=general::stringToArray("[php_property:field]", true);

$fieldValue="[php_property:field_value]";

if ($fieldValue == "")
    {
    $fieldValue="id";
    }


foreach (db::getData("[php_property:table]", "[php_property:where]", "[php_property:orderby]") as $optionData)
    {
    echo '<option value="' . $optionData[$fieldValue] . '"';
    
    
     if ("[php_property:selected_value]" !== "")
        {
        if ($optionData[$fieldValue] == "[php_property:selected_value]")
        //if ($optionData[$fieldValue] == $[php_property:var]["[php_property:selected_value]"])
            {
            echo ' selected="selected"';
            }
        }
    
    

    echo '>';
    //echo $optionData[$field] . " ";

    foreach ($field as $fieldItem)
        {
        echo $optionData[$fieldItem] . " ";
        }

    echo '</option>';
    }
?>